package com.itheima.edu.info.manager.day15;

import java.io.*;
import java.net.ServerSocket;
import java.net.Socket;

public class TcpShuangXiang {
    public static void main(String[] args) throws IOException {
        Socket s = new Socket("127.0.0.1",4396);
        byte[] b = new byte[3333];
        InputStream is =new  FileInputStream("D://百度云//下载//新建文件夹//新建文件夹//谷歌下载//ideaIU-2020.3.2.exe");
        int a;
        OutputStream os = s.getOutputStream();
        while ((a= is.read(b))!=-1){
            os.write(b,0,a);
        }
        s.shutdownOutput();

        BufferedReader br=new BufferedReader(new InputStreamReader(s.getInputStream()));
        String c;
        while ((c=br.readLine())!=null)
            System.out.println(c);
        os.close();
        s.close();
        is.close();
        br.close();




    }
}
